package net.mgsx.product.t2m.modisco.impact;
import org.eclipse.gmt.modisco.java.ASTNode;
import org.eclipse.gmt.modisco.infra.query.core.exception.ModelQueryExecutionException;
import org.eclipse.gmt.modisco.infra.query.core.java.IJavaModelQuery;
import org.eclipse.gmt.modisco.infra.query.core.java.ParameterValueList;

public class AnalyseElementsModifications implements IJavaModelQuery<ASTNode, Boolean> {
	public Boolean evaluate(final ASTNode context, final ParameterValueList parameterValues)
			throws ModelQueryExecutionException {
		// simply register element as to be analysed
		boolean result = false;
		if(AnalysisStorage.getInstance().willBeAnalysed(context)){
			AnalysisStorage.getInstance().addAsModifiedElement(context);
			result = true;
		}
		return result;
	}
}
